import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter)

import Home from '@/pages/Home'
import Search from '@/pages/Search'
import Login from '@/pages/Login'
import Register from '@/pages/Register'

export default new VueRouter({
    routes:[
        {
            path: '/home',
            component: Home,
            meta:{show: true}
        },
        {
            name:'Search',
            path: '/search/:keyWord?',
            component: Search,
            meta:{show: true}
        },
        {
            path: '/login',
            component: Login,
            meta:{show: false}
        },
        {
            path: '/register',
            component: Register,
            meta:{show: false}
        },
        {
            // 设置重定向
            path:'/',
            redirect:'/home'
        }
    ]
})